home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / spaceambush.swf / scripts / frame_286 / PlaceObject2_279_38 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2007-03-12  |  1.0 KB  |  41 lines

  1. onClipEvent(enterFrame){
  2.    if(_root.amitavaplay == true)
  3.    {
  4.       if(att == true)
  5.       {
  6.          dx = _X - _root.tank._x;
  7.          dy = _Y - _root.tank._y;
  8.          d = Math.sqrt(dx * dx + dy * dy);
  9.          if(100 < d)
  10.          {
  11.             rad = Math.atan2(dy,dx) + 3.141592653589793;
  12.             deg = rad * 180 / 3.141592653589793;
  13.             _rotation = deg;
  14.             b = speed * Math.cos(rad);
  15.             p = speed * Math.sin(rad);
  16.             _X = _X + b;
  17.             _Y = _Y + p;
  18.             treadchecka++;
  19.             if(5 < treadchecka)
  20.             {
  21.                treadcounta++;
  22.                duplicateMovieClip(_root.treada,"treada" + treadcounta,16384 + (treadcounta % 200 + 2000));
  23.                treadchecka = 0;
  24.             }
  25.          }
  26.          else if(0 < _root.amithealth)
  27.          {
  28.             this.gotoAndStop(2);
  29.          }
  30.          else
  31.          {
  32.             this.gotoAndStop(1);
  33.          }
  34.       }
  35.    }
  36.    else
  37.    {
  38.       this.gotoAndStop(1);
  39.    }
  40. }
  41.